package com.srp.blockchain.mybatisplustest.controller;

import com.srp.blockchain.mybatisplustest.entity.UserRoleEntity;
import com.srp.blockchain.mybatisplustest.service.IUserRoleService;
import com.srp.common.utils.Result;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;


/**
 * @author dongl
 */
@Slf4j
@RestController
@RequestMapping("test")
public class UserRoleController {

    @Autowired
    private IUserRoleService userRoleService;

    /**
     *
     *
     * @param current
     * @param size
     * @return
     */
    @GetMapping("/one")
    public Result pagination(@RequestParam(defaultValue = "1") Integer current, @RequestParam(defaultValue = "10") Integer size,
                             @RequestParam(required = false) String name) {
        List<UserRoleEntity> listXml = userRoleService.getListXml();
        return Result.OK(listXml);
    }

}

